<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Article extends Common
{
    //
    public function classify(){
        return $this->belongsTo(Classify::class,'classifies_id');
    }
    //定义一个访问器#
   public function getClassifiesIdAttribute($key)
   {
        return Classify::find($key)->name;
   }
}
